package com.iflytek.day10;

/*
    学生类
 */
class _06_Student {
    private String name;
    private int age;

    public _06_Student() {}

    public _06_Student(String name) {
        this.name = name;
    }

    public _06_Student(int age) {
        this.age = age;
    }

    public _06_Student(String name,int age) {
        this.name = name;
        this.age = age;
    }

    public void show() {
        System.out.println(name + "," + age);
    }
}
/*
    测试类
 */
public class _06_StudentDemo {
    public static void main(String[] args) {
        //创建对象
        _06_Student s1 = new _06_Student();
        s1.show();

        //public Student(String name)
        _06_Student s2 = new _06_Student("林青霞");
        s2.show();

        //public Student(int age)
        _06_Student s3 = new _06_Student(30);
        s3.show();

        //public Student(String name,int age)
        _06_Student s4 = new _06_Student("林青霞",30);
        s4.show();
    }
}